The invention generally relates to systems and methods for performing floating point computation, and more particularly to systems and methods for performing floating point computations which conform to behavior specified in IEEE Standard (xe2x80x9cStd.xe2x80x9d) 754. The invention provides a common representational format for numbers and other values for which diverse formats are specified in IEEE Std. 754.
Digital electronic devices, such as digital computers, calculators, and other devices, perform arithmetic calculations on values in integer, or xe2x80x9cfixed point,xe2x80x9d format, in fractional, or xe2x80x9cfloating pointxe2x80x9d format, or both. IEEE Standard 754, (hereinafter xe2x80x9cIEEE Std. 754xe2x80x9d or xe2x80x9cthe Standardxe2x80x9d)) published in 1985 by the Institute of Electrical and Electronic Engineers, and adopted by the American National Standards Institute (ANSI), defines several standard formats for expressing values in floating point format, and a number of aspects regarding behavior of computation in connection therewith. In accordance with IEEE Std. 754, value (xe2x88x921)s2ef in a representation in floating point format comprises a plurality of binary digits, or xe2x80x9cbits,xe2x80x9d having the structure
s emsb . . . elsbfmsb . . . flsb
where bit xe2x80x9csxe2x80x9d is a sign bit indicating whether the entire value is positive or negative, bits xe2x80x9cemsb . . . elsbxe2x80x9d comprise an exponent field represent the exponent xe2x80x9cexe2x80x9d in unsigned binary biased format, and bits xe2x80x9cfmsb . . . flsbxe2x80x9d comprise a fraction field that represents the fractional portion xe2x80x9cfxe2x80x9d in unsigned binary format (xe2x80x9cmsbxe2x80x9d represents xe2x80x9cmost significant bitxe2x80x9d and xe2x80x9clsbxe2x80x9d represents xe2x80x9cleast significant bitxe2x80x9d). The Standard defines two general formats, namely, a xe2x80x9csinglexe2x80x9d format which comprises thirty-two bits, and a xe2x80x9cdoublexe2x80x9d format which comprises sixty-four bits. In the single format, there is one sign bit xe2x80x9cs,xe2x80x9d eight bits xe2x80x9ce7 . . . e0xe2x80x9d comprising the exponent field and twenty-three bits xe2x80x9cf22 . . . f0xe2x80x9d comprising the fraction field. In the double format, there is one sign bit xe2x80x9cs,xe2x80x9d eleven bits xe2x80x9ce10 . . . e0xe2x80x9d comprising the exponent field and fifty-two bits xe2x80x9cf51 . . . f0xe2x80x9d comprising the fraction field.
As indicated above, the exponent field of the floating point representation xe2x80x9cemsb . . . elsbxe2x80x9d represents the exponent xe2x80x9cExe2x80x9d in biased format. The biased format provides a mechanism by which the sign of the exponent is implicitly indicated. In particular, the bits xe2x80x9cemsb . . . elsbxe2x80x9d represent a binary encoded value xe2x80x9cexe2x80x9d such that xe2x80x9ce=E+bias.xe2x80x9d This allows the exponent E to extend from xe2x88x92126 to +127, in the eight-bit xe2x80x9csinglexe2x80x9d format, and from xe2x88x921022 to +1023 in the eleven-bit xe2x80x9cdoublexe2x80x9d format, and provides for relatively easy manipulation of the exponents in multiplication and division operations, in which the exponents are added and subtracted, respectively.
IEEE Std. 754 provides for several different formats with both the single and double formats which are generally based on the bit patterns of the bits xe2x80x9cemsb . . . elsbxe2x80x9d comprising the exponent field and the bits fmsb . . . flsb comprising the fraction field. If a number is represented all of the bits xe2x80x9cemsb . . . elsbxe2x80x9d of the exponent field are binary one""s (that is, if the bits represent a binary-encoded value of xe2x80x9c255xe2x80x9d in the single format or xe2x80x9c2047xe2x80x9d in the double format) and all of the bits fmsb . . . flsb of the fraction field are binary zeros, then the value of the number is positive or negative infinity, depending on the value of the sign bit xe2x80x9cs;xe2x80x9d in particular, the value xe2x80x9cvxe2x80x9d is v=(xe2x88x921)s∞, where xe2x80x9c∞xe2x80x9d represents the value xe2x80x9cinfinity.xe2x80x9d On the other hand, If all of the bits xe2x80x9cemsb . . . elsbxe2x80x9d of the exponent field are binary one""s and if the bits fmsb . . . flsb of the fraction field are not all zero""s, then the value that is represented is deemed xe2x80x9cnot a number,xe2x80x9d abbreviated in the Standard by xe2x80x9cNaN.xe2x80x9d
If a number has an exponent field in which the bits xe2x80x9cemsb . . . elsbxe2x80x9d are neither all binary ones nor all binary zeros (that is, if the bits represent a binary-encoded value between 1 and 254 in the single format or between 1 and 2046 in the double format), the number is said to be in a xe2x80x9cnormalizedxe2x80x9d format. For a number in the normalized format, the value represented by the number is v=(xe2x88x921)s2exe2x88x92bias (1.|fmsb . . . flsb), where xe2x80x9c|xe2x80x9d represents a concatenation operation. Effectively, in the normalized format, there is an implicit most significant digit having the value xe2x80x9cone,xe2x80x9d so that the twenty-three digits in the fraction field of the single format, or the fifty-two digits in the fraction field of the double format, will effectively represent a fraction having twenty-four digits or fifty-three digits of precision, respectively.
Finally, if a number has an exponent field in which the bits xe2x80x9cembs . . . elsbxe2x80x9d are all binary zeros, representing the binary-encoded value of xe2x80x9czero,xe2x80x9d the number is said to be in a xe2x80x9cde-normalizedxe2x80x9d format. For a number in the de-normalized format, the value represented by the number is v=(xe2x88x921)s2exe2x88x92bias(0.|fmsb . . . flsb). It will be appreciated that the range of values of numbers that can be expressed in the de-normalized format is disjoint from the range of values of numbers that can be expressed in the normalized format, for both the single and double formats.
A problem arises in connection with numbers in the de-normalized format. In particular, numbers in the de-normalized format are difficult to process and to produce.
The invention provides anew and improved system and method for performing floating point computations on numbers using a new representation that provides a common representational format for numbers which would, in accordance with the IEEE Std. 754, be in normalized format as well as numbers which would, in accordance with the IEEE Std. 754, be in de-normalized format. The invention further provides an arrangement for converting numbers between the new representation and the respective normalized or de-normalized format, as appropriate.
In brief summary, embodiments of the invention provide a system for performing floating point computation in connection with numbers in a base floating point representation that defines a plurality of formats, including a normalized format and a de-normalized format, using a common floating point representation that defines a unitary normalized format. The system comprises a base to common representation converter and a processor. The base to common representation converter is configured to convert the numbers in the base floating point representation to a common floating point representation, so that all numbers involved in a computatoin will be expressed in the unitary normalized format. The processor is configured to perform a mathematical operation of at least one predetermined type in connection with the converted numbers generated by said representation converter to generate a floating point result in the common representation. Embodiments of the invention can further comprise a common to base representation converter configured to convert numbers from the common floating point representation selectively to either the normalized or de-normalized format of the base representation. In particular embodiments of the invention, the base floating point representation corresponds to that defined by the IEEE Std. 754.
By providing a common floating point representation, the floating point numbers in the base floating point representation that are to be used during a computation can be converted to the common floating point representation, and the computation can proceed using the common representation. This will eliminate the necessity of converting numbers between normalized and de-normalized formats during the computation which may be necessary in, for example, computations involving numbers that are represented in different formats in the IEEE Std. 754 representation.